<?php
namespace app\shop;

use cubox;

class App extends cubox\App{
    
    public function init(){
       
    }

    public function cache(string $name=''):cubox\Cache{
        
        $cache = parent::cache($name);
        
        if (get_class($cache) !== 'cubox\cache\Redis'){
            throw new \Exception('应用只支持 redis 缓存');
        }else{
            return $cache;
        }
    }
}